package com.htsk.city.services.wechat.params;

import cn.hutool.core.date.DateUtil;
import com.htsk.city.services.core.domain.Comment;
import com.htsk.city.services.core.domain.WxUser;
import lombok.Data;

@Data
public class PublishCommmentParam {
    private Long postId;
    private String content;
    private Long parentId;
    private Long replyToUserId;

    public Comment getComment(WxUser wxUser){
        Comment comment = new Comment();
        comment.setPostId(postId);
        comment.setContent(content);
        comment.setParentId(parentId);
        comment.setReplyToUserId(replyToUserId);
        comment.setUserId(wxUser.getId());
        comment.setCreatedAt(DateUtil.date());
        comment.setLikeCount(0);
        comment.setDelFlag(0);
        return comment;
    }
}
